public class President extends Approver {
    public President(String name) {
        super(name);
    }

    @Override
    public void processRequest(PurchaseRequest request) {
        if (request.getAmount() < 500000) {
            System.out.println("President " + this.name + " approves request: " + request.getNumber() + ", amount: " + request.getAmount() + ", purpose: " + request.getPurpose() + ".");
        } else {
            successor.processRequest(request);
        }
    }
}